package org.jeecg.modules.demo.temple.order.service.impl;

import org.jeecg.modules.demo.temple.order.entity.TempleActivityOrder;
import org.jeecg.modules.demo.temple.order.mapper.TempleActivityOrderMapper;
import org.jeecg.modules.demo.temple.order.mapper.TempleDonationOrderMapper;
import org.jeecg.modules.demo.temple.order.service.ITempleActivityOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.List;
import java.util.Map;

/**
 * @Description: 活动订单表
 * @Author: jeecg-boot
 * @Date:   2022-05-06
 * @Version: V1.0
 */
@Service
public class TempleActivityOrderServiceImpl extends ServiceImpl<TempleActivityOrderMapper, TempleActivityOrder> implements ITempleActivityOrderService {

    @Autowired
    private TempleDonationOrderMapper templeDonationOrderMapper;
    @Autowired
    private TempleActivityOrderMapper templeActivityOrderMapper ;

    /**
     * @Description 设置支付支付状态
     * @param isPay Y：已支付; N：未支付
     * @param list  符合条件的id
     */
    @Override
    public void setIsPayState(String isPay, List list) {
        templeDonationOrderMapper.setIsPayState(isPay,list);
    }

    // 计算当日活动订单总金额、总订单数、历史订单总金额、历史总订单数
    public Map todayActivityData(String sys_org_code) {
        Map todayActivityData = templeActivityOrderMapper.todayActivityData(sys_org_code);
        return todayActivityData ;

    }
    // 分类查询活动订单总金额、总订单数
    public List<Map> classifyActivityData( String sys_org_code) {
        List<Map> classifyActivityData = templeActivityOrderMapper.classifyActivityData(sys_org_code);
        return classifyActivityData ;
    }

    /**
     *
     * @Description 查询7天活动数据
     * @date 2022/6/15 10:20
     * @param sys_org_code
     * @return List<Map>
     */


    @Override
    public List<Map> activity7DayData(String sys_org_code) {
        List<Map> activity7DayData = templeActivityOrderMapper.activity7DayData(sys_org_code);
        return activity7DayData;
    }

    /**
     *
     * @Description 查询1个月活动数据
     * @date 2022/6/15 10:21
     * @param sys_org_code
     * @return List<Map>
     */


    @Override
    public List<Map> activityOneMonthData(String sys_org_code) {
        List<Map> activityOneMonthData = templeActivityOrderMapper.activityOneMonthData(sys_org_code);
        return activityOneMonthData;
    }
    /**
     *
     * @Description 查询3个月活动数据
     * @date 2022/6/15 10:21
     * @param sys_org_code
     * @return List<Map>
     */


    @Override
    public List<Map> activityThreeMonthData(String sys_org_code) {
        List<Map> activityThreeMonthData = templeActivityOrderMapper.activityThreeMonthData(sys_org_code);
        return activityThreeMonthData;
    }

    /**
     *
     * @Description 查询半年活动数据
     * @date 2022/6/15 10:24
     * @param sys_org_code
     * @return List<Map>
     */



    @Override
    public List<Map> activityHalfData(String sys_org_code) {
        List<Map> activityHalfData = templeActivityOrderMapper.activityHalfData(sys_org_code);
        return activityHalfData;
    }
    /**
     *
     * @Description 查询1年活动数据
     * @date 2022/6/15 10:24
     * @param sys_org_code
     * @return List<Map>
     */


    @Override
    public List<Map> activityOneYearData(String sys_org_code) {
        List<Map> activityOneYearData = templeActivityOrderMapper.activityOneYearData(sys_org_code);
        return activityOneYearData;
    }
    @Override
    public List<Map> activityDashBoardQuery(String sys_org_code, String begin, String end) {
        List<Map> activityDateQuery = templeActivityOrderMapper.activityDashBoardQuery(sys_org_code, begin, end);
        return activityDateQuery;
    }


}
